import { Component, OnInit } from '@angular/core';
import { ListService } from '../serves/list.service'
@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
  title:string='有意思'
  list:Array<string>=['Angular','react']
  listcolor:Array<string>=[]
  constructor(
    private listService:ListService
  ) { }

  ngOnInit(): void {
    this.listcolor=this.listService.getlist();

  }
  titleChange(){
    this.title='没意思';
  }
  addList(str:string){
    this.list?.push(str);
  }
  addyellow(){
    this.listService.setlist('yellow')
  }
}
